<!-- Per Service Type navigation bar -->
<script id="metadata.list.template" type="text/x-handlebars-template">
      <div class="container">
        <div class="navbar-header">
          <span class="navbar-brand"><a id="scoutsuite_navbar" class="text-white" href="javascript:showMainDashboard()">Scout</a></span>
        </div>
        <div class="navbar-collapse collapse">
            <ul class="nav navbar-nav">
                {{#each items}}
                <li id="{{@key}}_navbar" class="nav-item dropdown">
                    <a href="#" class="nav-link dropdown-toggle" role="button" data-toggle="dropdown">{{makeTitle @key}}</a>
                    <ul class="dropdown-menu" role="button">
                        {{#if summaries}}
                            <li class="dropdown-submenu">
                                <a href="#" class="dropdown-toggle nav-link" data-toggle="dropdown">Summaries</a>
                                <ul class="dropdown-menu">
                                    {{#each summaries}}
                                    <li><a class="dropdown-item nav-link" href="#{{path}}" id="{{@key}}_subnavbar">{{makeTitle @key}}</a></li>
                                    {{/each}}
                                </ul>
                                <div class="dropdown-divider"></div>
                            </li>
                        {{/if}} 

                        {{#each this}} {{#unlessEqual @key 'summaries'}} {{#unless hidden}}
                            <li class="dropdown-submenu">
                                <a href="#" class="dropdown-toggle nav-link" data-toggle="dropdown">{{ makeTitle @key }}</a>
                                <ul class="dropdown-menu">
                                    <li class="dropdown-header">Summaries</li>
                                    <li><a class="dropdown-item" href="#services.{{@key}}.findings" id="{{@key}}_subnavbar">Dashboard</a></li>
                                    {{#each summaries}} {{#if risks}}
                                        <li class="dropdown-submenu"><a href="#{{path}}" id="{{@key}}_subnavbar">{{makeTitle @key}}</a>
                                            <ul class="dropdown-menu">
                                                <li class="dropdown-header">Security risks</li>
                                                {{#each risks}}
                                                <li><a class="dropdown-item" href="#services.{{@../../key}}.findings.{{this}}.items" id="{{@key}}_subnavbar">
                                                    {{getValueAt 'services' @../../key 'findings' this 'description'}}
                                                </a></li>
                                                {{/each}}
                                            </ul>
                                        </li>
                                    {{else}}
                                        <li><a class="dropdown-item" href="#{{path}}" id="{{@key}}_subnavbar">{{makeTitle @key}}</a></li>
                                    {{/if}} {{/each}}

                                    <li class="dropdown-divider"></li>
                                    <li class="dropdown-header">{{makeTitle @key}} config</li>
                                    {{#each resources}} {{#unless hidden}} {{#if risks}}
                                        <li class="dropdown-submenu"><a href="#{{path}}" id="{{@key}}_subnavbar">{{makeTitle @key}} ({{count}})</a>
                                            <ul class="dropdown-menu">
                                                <li class="dropdown-header">Security risks</li>
                                                {{#each risks}}
                                                <li><a class="dropdown-item" href="#services.{{@../../key}}.findings.{{this}}.items" id="{{@key}}_subnavbar">
                                                    {{getValueAt 'services' @../../key 'findings' this 'description'}}
                                                </a></li>
                                                {{/each}}
                                            </ul>
                                        </li>
                                    {{else}} {{#if count}}
                                        <li><a class="dropdown-item" href="#{{path}}" id="{{@key}}_subnavbar">{{makeTitle @key}} ({{count}})</a></li>
                                    {{else}}
                                        <li class="disabled"><a class="dropdown-item disabled" href="">{{makeTitle @key}}</a></li>
                                    {{/if}} {{/if}} {{/unless}} {{/each}}
                                </ul>
                            </li>
                        {{/unless}} {{/unlessEqual}} {{/each}}
                    </ul>
                </li>
                {{/each}}
            </ul>

            <ul class="nav navbar-nav ml-auto">
              <li class="nav-item dropdown">
                <a href="#" class="nav-link dropdown-toggle" data-toggle="dropdown">Filters</a>
                <ul class="dropdown-menu" id="filters.list">
                </ul>
              </li>
              <li class="nav-item dropdown">
                <a href="#" class="nav-link dropdown-toggle" data-toggle="dropdown"><i class="fa fa-cog"></i></a>
                <ul class="dropdown-menu">
                  <li><a class="dropdown-item" href="javascript:showLastRunDetails()">Execution Details</a></li>
                  <li><a class="dropdown-item" href="javascript:showResourcesDetails()">Resources Details</a></li>
                  <li><a class="dropdown-item" href="javascript:downloadExceptions()">Export Exceptions</a><a id="downloadAnchorElem" style="display:none"></a></li>
                  <li><a class="dropdown-item" href="javascript:exportSummary()">Export Summary</a></li>
                    <li><a class="dropdown-item" href="javascript:showAbout()">About Scout</a></li>
                  <li><span>Dark theme</span>
                    <label class="switch">
                      <input type="checkbox" id="theme_checkbox" onclick="toggleTheme()">
                      <span class="slider round"></span>
                    </label></a>
                  </li>
                </ul>
              </li>
            </ul>
          </div>
      </div>
  </script>

<script src="inc-scoutsuite/theme.js"></script>
<script>
    loadLastTheme();
    if (isDarkThemeEnabled() && document.getElementById("theme_checkbox")) {
        document.getElementById("theme_checkbox").checked = true;
    }
</script>
